//
//  FCCenterViewController.swift
//  FinancialConsulting
//
//  Created by Max on 2017/10/26.
//  Copyright © 2017年 com.vector. All rights reserved.
//

import UIKit

class FCCenterViewController: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        if let v = FCMainViewController.create() as? FCMainViewController {
            v.title = "主页"
            let main = UINavigationController(rootViewController:v)
            main.tabBarItem.image = UIImage(named:"1")
            main.tabBarItem.selectedImage = UIImage(named:"5")
            main.tabBarItem.title = "主页"
            if let v = FCAlongNotesViewController.create() as? FCAlongNotesViewController {
                v.title = "记一记"
                let certification = UINavigationController(rootViewController:v)
                certification.tabBarItem.image = UIImage(named:"2")
                certification.tabBarItem.selectedImage = UIImage(named:"4")
                certification.tabBarItem.title = "记一记"
                if let v = FCMineViewController.create() as? FCMineViewController {
                    v.title = "我的"
                    let mine = UINavigationController(rootViewController:v)
                    mine.tabBarItem.image = UIImage(named:"3")
                    mine.tabBarItem.selectedImage = UIImage(named:"6")
                    mine.tabBarItem.title = "我的"
                    self.viewControllers = [main,certification,mine]
                }
            }
        }
        self.selectedIndex = 0
    }
    
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        self.navigationController?.isNavigationBarHidden = true
    }
    
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

}
